package com.gemme.gemme.manager;

import android.app.Activity;
import android.content.Context;
import android.util.Log;

import org.json.JSONObject;

/**
 * @Author: yangcheng
 * @CreateDate: 2020/8/25 11:19
 */
public class DataPares {
    public static final boolean isSucess(Context context, String response){
        boolean istrue = false;

        try {
            int code = (new JSONObject(response)).getInt("code");
            String msg = (new JSONObject(response)).getString("msg");
            if(code == 0){
                istrue = true;
            }else{
                istrue = false;

            }
        }catch (Exception e){

        }
        if(context instanceof Activity){
            Activity activity = (Activity) context;
            Log.e(activity.getComponentName().getClassName(), response + "");
        }

        return istrue;
    }
}
